<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Agent extends Model
{
    protected $table = 'agent';
    
    /**
     * 是否主动维护时间戳
     *
     * @var bool
     */
    public $timestamps = false;
    
    public static function getUnicode(){
        $unicode = strtolower(random(6));
        if (Agent::where('code',$unicode)->value('id') > 0) return Agent::getUnicode();
        return $unicode;
    }
}
